﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Meqs.Entity;
using Meqs.Entity.Views;
using Meqs.Logic.Interface;

namespace Meqs.Logic.Implement
{
    public class ClassEvalTypeCatchLogic : CommonLogic<ClassEvalTypeCatch, int>, IClassEvalTypeCatchLogic
    {
        #region Implementation of ICommonLogic<ClassEvalTypeCatch, int>

        /// <summary>
        /// 创建对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Create(ClassEvalTypeCatch entity)
        {
            return CreateObject(entity);
        }

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Update(ClassEvalTypeCatch entity)
        {
            return UpdateObject(entity);
        }

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public int Delete(int entityId)
        {
            return DeleteObject(entityId);
        }

        /// <summary>
        /// 删除所有对象
        /// </summary>
        /// <returns></returns>
        public int DeleteAll()
        {
            return DeleteAllObject();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public ClassEvalTypeCatch FindById(int entityId)
        {
            return FindObjectById(entityId);
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount()
        {
            return FindObjectByCount();
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<ClassEvalTypeCatch> FindAll()
        {
            return FindAllObject();
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount(Hashtable table)
        {
            return FindObjectByCount(table);
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<ClassEvalTypeCatch> FindAll(Hashtable table)
        {
            return FindObject(table);
        }

        #endregion

        /// <summary>
        /// 插入
        /// </summary>
        public int InsertClassEvalTypeCatch(ClassEvalTypeCatch mpic, string schoolMark)
        {
            Hashtable ht = new Hashtable();
            ht.Add("ClassEvalTypeCatch", mpic);
            ht.Add("SchoolMark", schoolMark);
            return (int)InsertCustomer("ClassEvalTypeCatch.InsertClassEvalTypeCatch", ht);
        }

        /// <summary>
        /// 删除
        /// </summary>
        public int DeleteClassEvalTypeCatch(int classID, int recordID, string schoolMark)
        {
            Hashtable ht = new Hashtable();
            ht.Add("ClassID", classID);
            ht.Add("RecordID", recordID);
            ht.Add("SchoolMark", schoolMark);
            return DeleteCustomer("ClassEvalTypeCatch.DeleteClassEvalTypeCatch", ht);
        }

        /// <summary>
        /// 学生干部活动统计
        /// </summary>
        public IList<GoodCadreView> FindGoodCadre(String schoolMark, int schoolYear, int term, DateTime start, DateTime end, int grade)
        {
            Hashtable ht = new Hashtable();
            ht.Add("SchoolYear", schoolYear);
            ht.Add("Term", term);
            ht.Add("SchoolMark", schoolMark);
            ht.Add("BeginDate", start);
            ht.Add("EndDate", end);
            ht.Add("Grade", grade);
            return FindCustomer<GoodCadreView>("ClassEvalTypeCatch.FindGoodCadre", ht);
        }

        /// <summary>
        /// 学分管理优秀班级评测
        /// </summary>
        public IList<GoodCadreView> FindGoodClass(String schoolMark, int schoolYear, int term, DateTime start, DateTime end, int grade)
        {
            Hashtable ht = new Hashtable();
            ht.Add("SchoolYear", schoolYear);
            ht.Add("Term", term);
            ht.Add("SchoolMark", schoolMark);
            ht.Add("BeginDate", start);
            ht.Add("EndDate", end);
            ht.Add("Grade", grade);
            return FindCustomer<GoodCadreView>("ClassEvalTypeCatch.FindGoodClass", ht);
        }

        /// <summary>
        /// 德育的周报表, 日报表
        /// </summary>
        public IList<GoodCadreView> FindDayOrWeekReprot(String schoolMark, int schoolYear, int term, DateTime start, DateTime end, int grade, String keyWord)
        {
            Hashtable ht = new Hashtable();
            ht.Add("SchoolYear", schoolYear);
            ht.Add("Term", term);
            ht.Add("SchoolMark", schoolMark);
            ht.Add("BeginDate", start);
            ht.Add("EndDate", end);
            ht.Add("Grade", grade);
            ht.Add("KeyWord", keyWord);
            return FindCustomer<GoodCadreView>("ClassEvalTypeCatch.FindDayOrWeekReprot", ht);
        }
    }
}
